'use strict'

/**
 * 管理后台用户表
 * @param {*} app 
 * @returns 
 */
module.exports = app => {
  const { sequelize, DataTypes } = app
  const { STRING, INTEGER, DATE } = DataTypes
  const tableName = 'users_admin'

  const UsersAdmin = sequelize.define(tableName, {
    user_id: { type: INTEGER, primaryKey: true, autoIncrement: true },
    user_name: { type: STRING(255) },
    password: { type: STRING(255) },
    phone: { type: STRING(11) },
    avater: { type: STRING(255) },
    // created_at: DATE,
    // updated_at: DATE,
  }, {
    tableName,
    comment: '管理后台用户表',
    timestamps: false
  })
  
  return UsersAdmin
}